package com.jintian.smart.kernel.web.config;

import cn.dev33.satoken.config.SaTokenConfig;
import com.jintian.smart.base.api.security.provider.ILevel3ProtectConfigProvider;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Configuration;

/**
 * 三级等保配置初始化后最低活跃频率全局配置
 */
@Configuration
public class TokenConfig {
    @Resource
    private ILevel3ProtectConfigProvider level3ProtectConfigProvider;

    // 此配置会覆盖 smart-platform.yaml 中的配置
    @Resource
    public void configSaToken(SaTokenConfig config) {
        config.setActiveTimeout(level3ProtectConfigProvider.getLoginActiveTimeoutSeconds());
    }
}
